package com.example.demo;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.Banner.Mode;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.example.config.AuthorSettings;

@Controller
@ComponentScan("com.example.*")
@MapperScan("com.example.dao")
@SpringBootApplication
public class DemoApplication {
	
	@Value("${book.author}")
	private String bookAuthor;
	@Value("${book.name}")
	private String bookName;
	
//	@Autowired
//	private AuthorSettings authorSettings;
	
//	@RequestMapping("/")
//	String index(){
//		return "index";
//	}
	
	@RequestMapping("/about")
	public String test(){
//		return "author.name:" + authorSettings.getName() + ", age:" + authorSettings.getAge();
		return "about";
	}

	public static void main(String[] args) {
		SpringApplication app = new SpringApplication(DemoApplication.class);
		app.setBannerMode(Mode.OFF);// 关闭banner
		app.run(args);
//		SpringApplication.run(DemoApplication.class, args);
		
	}
}
